/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.triumphsys.icici.cmeeting.portlet.model.impl;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposal;
import com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposalModel;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.Date;

/**
 * The base model implementation for the CMPoliciesProposal service. Represents a row in the &quot;CM_POLICIES_PROPOSAL&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposalModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CMPoliciesProposalImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a c m policies proposal model instance should use the {@link com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposal} interface instead.
 * </p>
 *
 * @author Triumphsys
 * @see CMPoliciesProposalImpl
 * @see com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposal
 * @see com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposalModel
 * @generated
 */
public class CMPoliciesProposalModelImpl extends BaseModelImpl<CMPoliciesProposal>
	implements CMPoliciesProposalModel {
	public static final String TABLE_NAME = "CM_POLICIES_PROPOSAL";
	public static final Object[][] TABLE_COLUMNS = {
			{ "policiesProposalId", new Integer(Types.BIGINT) },
			{ "codCcmDt", new Integer(Types.TIMESTAMP) },
			{ "branchId", new Integer(Types.BIGINT) },
			{ "approvalTl", new Integer(Types.VARCHAR) },
			{ "loanAmt", new Integer(Types.BIGINT) },
			{ "ipNetM", new Integer(Types.VARCHAR) },
			{ "proposalName", new Integer(Types.VARCHAR) },
			{ "reportingAId1", new Integer(Types.BIGINT) },
			{ "reportingAId2", new Integer(Types.BIGINT) },
			{ "model", new Integer(Types.VARCHAR) },
			{ "methodology", new Integer(Types.VARCHAR) },
			{ "smId1", new Integer(Types.BIGINT) },
			{ "smId2", new Integer(Types.BIGINT) },
			{ "program", new Integer(Types.VARCHAR) },
			{ "programExpiry", new Integer(Types.TIMESTAMP) },
			{ "proposalId", new Integer(Types.BIGINT) }
		};
	public static final String TABLE_SQL_CREATE = "create table CM_POLICIES_PROPOSAL (policiesProposalId LONG not null primary key,codCcmDt DATE null,branchId LONG,approvalTl VARCHAR(75) null,loanAmt LONG,ipNetM VARCHAR(75) null,proposalName VARCHAR(75) null,reportingAId1 LONG,reportingAId2 LONG,model VARCHAR(75) null,methodology VARCHAR(75) null,smId1 LONG,smId2 LONG,program VARCHAR(75) null,programExpiry DATE null,proposalId LONG)";
	public static final String TABLE_SQL_DROP = "drop table CM_POLICIES_PROPOSAL";
	public static final String ORDER_BY_JPQL = " ORDER BY cmPoliciesProposal.policiesProposalId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CM_POLICIES_PROPOSAL.policiesProposalId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposal"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposal"),
			true);
	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposal"));

	public CMPoliciesProposalModelImpl() {
	}

	public long getPrimaryKey() {
		return _policiesProposalId;
	}

	public void setPrimaryKey(long pk) {
		setPoliciesProposalId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_policiesProposalId);
	}

	public long getPoliciesProposalId() {
		return _policiesProposalId;
	}

	public void setPoliciesProposalId(long policiesProposalId) {
		_policiesProposalId = policiesProposalId;
	}

	public Date getCodCcmDt() {
		return _codCcmDt;
	}

	public void setCodCcmDt(Date codCcmDt) {
		_codCcmDt = codCcmDt;
	}

	public long getBranchId() {
		return _branchId;
	}

	public void setBranchId(long branchId) {
		_branchId = branchId;
	}

	public String getApprovalTl() {
		if (_approvalTl == null) {
			return StringPool.BLANK;
		}
		else {
			return _approvalTl;
		}
	}

	public void setApprovalTl(String approvalTl) {
		_approvalTl = approvalTl;
	}

	public long getLoanAmt() {
		return _loanAmt;
	}

	public void setLoanAmt(long loanAmt) {
		_loanAmt = loanAmt;
	}

	public String getIpNetM() {
		if (_ipNetM == null) {
			return StringPool.BLANK;
		}
		else {
			return _ipNetM;
		}
	}

	public void setIpNetM(String ipNetM) {
		_ipNetM = ipNetM;
	}

	public String getProposalName() {
		if (_proposalName == null) {
			return StringPool.BLANK;
		}
		else {
			return _proposalName;
		}
	}

	public void setProposalName(String proposalName) {
		_proposalName = proposalName;
	}

	public long getReportingAId1() {
		return _reportingAId1;
	}

	public void setReportingAId1(long reportingAId1) {
		_reportingAId1 = reportingAId1;
	}

	public long getReportingAId2() {
		return _reportingAId2;
	}

	public void setReportingAId2(long reportingAId2) {
		_reportingAId2 = reportingAId2;
	}

	public String getModel() {
		if (_model == null) {
			return StringPool.BLANK;
		}
		else {
			return _model;
		}
	}

	public void setModel(String model) {
		_model = model;
	}

	public String getMethodology() {
		if (_methodology == null) {
			return StringPool.BLANK;
		}
		else {
			return _methodology;
		}
	}

	public void setMethodology(String methodology) {
		_methodology = methodology;
	}

	public long getSmId1() {
		return _smId1;
	}

	public void setSmId1(long smId1) {
		_smId1 = smId1;
	}

	public long getSmId2() {
		return _smId2;
	}

	public void setSmId2(long smId2) {
		_smId2 = smId2;
	}

	public String getProgram() {
		if (_program == null) {
			return StringPool.BLANK;
		}
		else {
			return _program;
		}
	}

	public void setProgram(String program) {
		_program = program;
	}

	public Date getProgramExpiry() {
		return _programExpiry;
	}

	public void setProgramExpiry(Date programExpiry) {
		_programExpiry = programExpiry;
	}

	public long getProposalId() {
		return _proposalId;
	}

	public void setProposalId(long proposalId) {
		_proposalId = proposalId;
	}

	public CMPoliciesProposal toEscapedModel() {
		if (isEscapedModel()) {
			return (CMPoliciesProposal)this;
		}
		else {
			return (CMPoliciesProposal)Proxy.newProxyInstance(CMPoliciesProposal.class.getClassLoader(),
				new Class[] { CMPoliciesProposal.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public ExpandoBridge getExpandoBridge() {
		if (_expandoBridge == null) {
			_expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(0,
					CMPoliciesProposal.class.getName(), getPrimaryKey());
		}

		return _expandoBridge;
	}

	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		getExpandoBridge().setAttributes(serviceContext);
	}

	public Object clone() {
		CMPoliciesProposalImpl cmPoliciesProposalImpl = new CMPoliciesProposalImpl();

		cmPoliciesProposalImpl.setPoliciesProposalId(getPoliciesProposalId());

		cmPoliciesProposalImpl.setCodCcmDt(getCodCcmDt());

		cmPoliciesProposalImpl.setBranchId(getBranchId());

		cmPoliciesProposalImpl.setApprovalTl(getApprovalTl());

		cmPoliciesProposalImpl.setLoanAmt(getLoanAmt());

		cmPoliciesProposalImpl.setIpNetM(getIpNetM());

		cmPoliciesProposalImpl.setProposalName(getProposalName());

		cmPoliciesProposalImpl.setReportingAId1(getReportingAId1());

		cmPoliciesProposalImpl.setReportingAId2(getReportingAId2());

		cmPoliciesProposalImpl.setModel(getModel());

		cmPoliciesProposalImpl.setMethodology(getMethodology());

		cmPoliciesProposalImpl.setSmId1(getSmId1());

		cmPoliciesProposalImpl.setSmId2(getSmId2());

		cmPoliciesProposalImpl.setProgram(getProgram());

		cmPoliciesProposalImpl.setProgramExpiry(getProgramExpiry());

		cmPoliciesProposalImpl.setProposalId(getProposalId());

		return cmPoliciesProposalImpl;
	}

	public int compareTo(CMPoliciesProposal cmPoliciesProposal) {
		int value = 0;

		if (getPoliciesProposalId() < cmPoliciesProposal.getPoliciesProposalId()) {
			value = -1;
		}
		else if (getPoliciesProposalId() > cmPoliciesProposal.getPoliciesProposalId()) {
			value = 1;
		}
		else {
			value = 0;
		}

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		CMPoliciesProposal cmPoliciesProposal = null;

		try {
			cmPoliciesProposal = (CMPoliciesProposal)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = cmPoliciesProposal.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(33);

		sb.append("{policiesProposalId=");
		sb.append(getPoliciesProposalId());
		sb.append(", codCcmDt=");
		sb.append(getCodCcmDt());
		sb.append(", branchId=");
		sb.append(getBranchId());
		sb.append(", approvalTl=");
		sb.append(getApprovalTl());
		sb.append(", loanAmt=");
		sb.append(getLoanAmt());
		sb.append(", ipNetM=");
		sb.append(getIpNetM());
		sb.append(", proposalName=");
		sb.append(getProposalName());
		sb.append(", reportingAId1=");
		sb.append(getReportingAId1());
		sb.append(", reportingAId2=");
		sb.append(getReportingAId2());
		sb.append(", model=");
		sb.append(getModel());
		sb.append(", methodology=");
		sb.append(getMethodology());
		sb.append(", smId1=");
		sb.append(getSmId1());
		sb.append(", smId2=");
		sb.append(getSmId2());
		sb.append(", program=");
		sb.append(getProgram());
		sb.append(", programExpiry=");
		sb.append(getProgramExpiry());
		sb.append(", proposalId=");
		sb.append(getProposalId());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(52);

		sb.append("<model><model-name>");
		sb.append(
			"com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposal");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>policiesProposalId</column-name><column-value><![CDATA[");
		sb.append(getPoliciesProposalId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>codCcmDt</column-name><column-value><![CDATA[");
		sb.append(getCodCcmDt());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>branchId</column-name><column-value><![CDATA[");
		sb.append(getBranchId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>approvalTl</column-name><column-value><![CDATA[");
		sb.append(getApprovalTl());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>loanAmt</column-name><column-value><![CDATA[");
		sb.append(getLoanAmt());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>ipNetM</column-name><column-value><![CDATA[");
		sb.append(getIpNetM());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>proposalName</column-name><column-value><![CDATA[");
		sb.append(getProposalName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>reportingAId1</column-name><column-value><![CDATA[");
		sb.append(getReportingAId1());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>reportingAId2</column-name><column-value><![CDATA[");
		sb.append(getReportingAId2());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>model</column-name><column-value><![CDATA[");
		sb.append(getModel());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>methodology</column-name><column-value><![CDATA[");
		sb.append(getMethodology());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>smId1</column-name><column-value><![CDATA[");
		sb.append(getSmId1());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>smId2</column-name><column-value><![CDATA[");
		sb.append(getSmId2());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>program</column-name><column-value><![CDATA[");
		sb.append(getProgram());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>programExpiry</column-name><column-value><![CDATA[");
		sb.append(getProgramExpiry());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>proposalId</column-name><column-value><![CDATA[");
		sb.append(getProposalId());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _policiesProposalId;
	private Date _codCcmDt;
	private long _branchId;
	private String _approvalTl;
	private long _loanAmt;
	private String _ipNetM;
	private String _proposalName;
	private long _reportingAId1;
	private long _reportingAId2;
	private String _model;
	private String _methodology;
	private long _smId1;
	private long _smId2;
	private String _program;
	private Date _programExpiry;
	private long _proposalId;
	private transient ExpandoBridge _expandoBridge;
}